﻿using Microsoft.AspNetCore.Http;
using Models.Common;
using UtilsCache;
using UtilsORM;
using UtilsORM.MySqlData;

////using System.Web.Script.Serialization;

namespace GatewayServerService.Data
{
    public class DBIotDeviceTaskTimeFixedLog
    {



        static string LogSave = UtilAppsettingCache.getSetting("base:logSave");
        //static object obj = new object();
        public bool saveLog(iot_device_task_time_fixed time_Fixed)
        {
            if (LogSave == "false")
            {
                return false;
            }
            EFYihongIotContext ef = new EFYihongIotContext();
            // lock (obj)
            //{

            iot_device_task_time_fixed_log model = new iot_device_task_time_fixed_log();
            //写入
            model.l_guid = Guid.NewGuid().ToString();
            model.l_tf_guid = time_Fixed.tf_guid;
            model.l_add_time = DateTime.Now;

            ef.iot_device_task_time_fixed_log.AddAsync(model);
            ef.SaveChanges();

            //删除锁

            return true;
        }
    }
}
